|
![](/i/fill.gif) |
On 17.02.2010 00:48, Christian Froeschlin wrote:
> I redesigned this as a pigment by replacing the layered texture
> with a pigment_map. Therefore, you can now define a pigment function
> and use that as normal pattern. Nice texture BTW ;)
>
> #local ClothScale = .5;
> #local ThreadWidth = .2;
> #local EdgeWidth = .08;
>
> #declare P_Cloth = pigment
> {
> gradient x
> color_map
> {
> [0 color Black]
> [.1 color Black]
> [.5 color White * 4]
> [.9 color Black]
> [1 color Black]
> }
> }
>
> #declare P_Cloth = pigment
> {
> gradient y
> pigment_map
> {
> [0 color Black]
> [.5 - ThreadWidth / 2 - EdgeWidth color Black]
> [.5 - ThreadWidth / 2 P_Cloth]
> [.5 + ThreadWidth / 2 P_Cloth]
> [.5 + ThreadWidth / 2 + EdgeWidth color Black]
> [1 color Black]
> }
> }
>
> #declare P_Cloth = pigment
> {
> average
> pigment_map
> {
> [1 P_Cloth]
> [1 P_Cloth translate <.5, .5, 0>]
> [1 P_Cloth rotate 90 * z translate <.5, 0, 0>]
> [1 P_Cloth rotate 90 * z translate <0, .5, 0>]
> }
> scale <ClothScale, ClothScale, 1>
> }
>
> #declare f_cloth = function {pigment {P_Cloth}}
>
> #declare N_Cloth = normal {function {f_cloth(x,y,z).red}}
>
sorry, but this will not work (as expected) as the function you feed
into the normal statement needs to evaluate the *slope* and not the
*height* at a specific point in 3d space.
-Ive
Post a reply to this message
|
![](/i/fill.gif) |